"""
tcp 粘包示例
"""
from socket import *
from time import sleep

sock = socket()
sock.bind(("0.0.0.0",8888))
sock.listen(5)

conn,addr = sock.accept()
sleep(0.01)
while True:
    data = conn.recv(1024)
    if not data or data == b"##":
        break
    print(data.decode())

conn.close()
sock.close()